package com.novoda.runbuddy.view;

import android.app.Activity;
import android.widget.LinearLayout;
import android.widget.TextView;
import android.view.ViewGroup;

import com.novoda.runbuddy.model.ListOfRuns;

public class TodayView extends LinearLayout {

	private TextView	distance;
	private TextView	heading_jogname;
	private TextView	timerun;

	public TodayView(Activity activity, TextView distance, TextView timerun, ListOfRuns allJogsRanToday) {
		super(activity);
		this.setOrientation(VERTICAL);

		if (timerun.getParent() != null) {
			((ViewGroup)timerun.getParent()).removeView(timerun);
		}
		this.timerun = timerun;
		distance.setText("00 miles");
		addView(timerun, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

		timerun.setText(allJogsRanToday.getTotalRunningTime());
		if (distance.getParent() != null) {
			((ViewGroup)distance.getParent()).removeView(distance);
		}
		this.distance = distance;
		addView(distance, new LinearLayout.LayoutParams(LayoutParams.FILL_PARENT, LayoutParams.WRAP_CONTENT));

	}

	public TextView getMiles() {
		return distance;
	}

	public void setMiles(String text) {
		this.distance.setText(text);
	}

	public TextView getHeading_jogname() {
		return heading_jogname;
	}

	public void setHeading_jogname(String text) {
		this.heading_jogname.setText(text);
	}

	public TextView getTimerun() {
		return timerun;
	}

	public void setTimerun(String text) {
		this.timerun.setText(text);
	}

}
